package com.aquila.bible.activity;

import android.os.Bundle;
import android.view.MotionEvent;

import com.aquila.bible.MyBaseActivity;
import com.aquila.bible.R;
import com.aquila.bible.utils.TextReader;
import com.aquila.bible.views.BookTextView;

public class TextContentActivity  extends MyBaseActivity{
	
	private int bookIndex, chapterIndex, totalChapter ;
	private boolean isNewTestament;
	private String title;
	private String chapterContentString;
	private String[] sections;
	private BookTextView view ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		view = new BookTextView(this) ;
//		setContentView(R.layout.activity_bookview_text) ;
		setContentView(view) ;
		
		bookIndex = getIntent().getIntExtra("bookIndex", 1) ;
		chapterIndex = getIntent().getIntExtra("chapterIndex", 1) ;
		totalChapter = getIntent().getIntExtra("totalChapter", 1) ;
		isNewTestament = getIntent().getBooleanExtra("isNewTestament", false) ;
		title = getIntent().getStringExtra("title") ;
		initRes() ;
		view.setContentString(chapterContentString) ;
		
//		view.setOnTouchListener(l)
		
	}
	
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		// TODO Auto-generated method stub
		view.onTouchEvent(event) ;
		
		return false ; //super.onTouchEvent(event);
	}
	
	private void initRes(){
		chapterContentString = TextReader.readChapter(context, bookIndex, chapterIndex) ;
		if (chapterContentString != null) {
			sections = chapterContentString.split("\n") ;
		}
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
